package artistportal.actions;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import artistportal.beans.LoginForm;

public class LoginAction extends Action {
	
	private static String SUCCESS = "success";
	private static String RETRY = "retry";
	
	public ActionForward execute (ActionMapping mapping, LoginForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		if (form.getUsername().equals("ravi") && form.getPassword().equals("ravi")) {
			return mapping.findForward(SUCCESS);
		}
		return mapping.findForward(RETRY);
	}

}
